﻿<?xml version="1.0" encoding="utf-8"?><Articles><Article><ArticlesID>883</ArticlesID><Title>Sử dụng ArrayList để fill dữ liệu v&amp;#224;o DropDownList</Title><Body>&amp;lt;p&amp;gt;Code aspx&amp;lt;/p&amp;gt;
&amp;lt;pre title=&amp;quot;code&amp;quot; class=&amp;quot;brush: xhtml;&amp;quot;&amp;gt;
&amp;amp;lt;%@ Page Language=&amp;amp;quot;C#&amp;amp;quot; Debug=&amp;amp;quot;true&amp;amp;quot; %&amp;amp;gt;
&amp;amp;lt;html&amp;amp;gt;
&amp;amp;lt;head&amp;amp;gt;
    &amp;amp;lt;title&amp;amp;gt;ArrayList Example&amp;amp;lt;/title&amp;amp;gt;
&amp;amp;lt;/head&amp;amp;gt;
&amp;amp;lt;body&amp;amp;gt;
    &amp;amp;lt;form id=&amp;amp;quot;Form1&amp;amp;quot; method=&amp;amp;quot;post&amp;amp;quot; runat=&amp;amp;quot;server&amp;amp;quot;&amp;amp;gt;
        &amp;amp;lt;asp:dropdownlist id=&amp;amp;quot;MyDropDownList&amp;amp;quot; runat=&amp;amp;quot;server&amp;amp;quot;&amp;amp;gt;&amp;amp;lt;/asp:dropdownlist&amp;amp;gt;
    &amp;amp;lt;/form&amp;amp;gt;
&amp;amp;lt;/body&amp;amp;gt;
&amp;amp;lt;/html&amp;amp;gt;&amp;lt;/pre&amp;gt;
&amp;lt;p&amp;gt;Code C#&amp;lt;/p&amp;gt;
&amp;lt;pre title=&amp;quot;code&amp;quot; class=&amp;quot;brush: csharp;&amp;quot;&amp;gt;
    void Page_Load()
    {
         ArrayList list = new ArrayList();
         list.Add(&amp;amp;quot;none&amp;amp;quot;);
         list.Add(&amp;amp;quot;Canada Post&amp;amp;quot;);
         list.Add(&amp;amp;quot;UPS&amp;amp;quot;);
    
         list.Insert(1,&amp;amp;quot;FedEx&amp;amp;quot;);
    
         MyDropDownList.DataSource = list;
         MyDropDownList.DataBind();
    }&amp;lt;/pre&amp;gt;</Body><CommentEnabled>True</CommentEnabled><ViewCount>0</ViewCount><ReleaseDate>4/17/2010 7:32:10 AM</ReleaseDate><TotalComment>0</TotalComment><IsMedia>False</IsMedia><IsPicture>False</IsPicture><IsVote>True</IsVote><ArticlePassword /><PostVisible>0</PostVisible><ArticlePath>/2010/4/12/ArrayList-to-fill-dropdown-value-373</ArticlePath><Approved>True</Approved><ImagePath /><CategoryId>26</CategoryId><ArrayCatID>26|25</ArrayCatID></Article></Articles>